﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using log4net;
using Microsoft.AspNetCore.Mvc;
using Suk.Interface;
using Suk.Interface.Admin;
using Suk.Models;
using Suk.Models.Admin;

namespace Suk.Web.Areas.Admin.Controllers
{
    [Area("Admin")]
    public class UserGroupController : SUBaseController<IUserGroupInterface, UserGroup>
    {
        public JsonResult TreeList()
        {

            UserGroup m = new UserGroup();
            m.Id = 9999;
            m.parentId = 0;
            m.title = "用户组管理";
            m.checkArr = "0";

            var getAll = _IService.FindEntity();
            getAll.Add(m);

            var data = new
            {
                status = new { code = 200, msg = "操作成功" },
                data = getAll
            };
            return Json(data);
        }

        public override JsonResult Add(UserGroup model)
        {
           // model.parentId=9999;
            model.checkArr = "0";
            return base.Add(model);
        }

    }
}